<table id="table-category" class="table table-striped">
    <tr>        
        <th>Chuyên mục</th>
        <th>Mô tả</th>
        <th>Ngày tạo</th>
        <th>Tổng Albums</th>
        <th>Trạng thái</th>
        <th>Thao tác</th>
    </tr>
    <?php
    foreach ($arrCategory as $cate) {
        ?>
        <tr id="row-cate-id-<?php echo $cate['category_id']; ?>">
            <td><?php echo $cate['title']; ?></td>
            <td><?php echo $cate['info']; ?></td>
            <td><?php echo strftime('%d/%m/%Y', $cate['create_date']); ?></td>
            <td><span class="badge"><?php echo $cate['total_album']; ?></span></td>
            <td><?php echo ($cate['status'] > 0) ? '<span class="label label-success">Enable</span>' : '<span class="label">Disable</span>'; ?></td>
            <td>
                <div class="hide" id="row-cate-value-<?php echo $cate['category_id']; ?>"><?php echo json_encode($cate); ?></div>
                <a href="javascript:void(0);" onclick="return editCategory(<?php echo $cate['category_id']; ?>);">Chỉnh sửa</a> / 
                <a href="javascript:void(0);" onclick="return deleteCategory(<?php echo $cate['category_id']; ?>);">Xoá</a>
            </td>
        </tr>
        <?php
        if (isset($cate['child'])) {
            foreach ($cate['child'] as $child) {
                ?>
                <tr id="row-cate-id-<?php echo $child['category_id']; ?>">
                    <td><i class="icon-minus"></i> <?php echo $child['title']; ?></td>
                    <td><?php echo $child['info']; ?></td>
                    <td><?php echo strftime('%d/%m/%Y', $child['create_date']); ?></td>
                    <td><span class="badge"><?php echo $child['total_album']; ?></span></td>
                    <td><?php echo ($child['status'] > 0) ? '<span class="label label-success">Enable</span>' : '<span class="label">Disable</span>'; ?></td>
                    <td>
                        <div class="hide" id="row-cate-value-<?php echo $child['category_id']; ?>"><?php echo json_encode($child); ?></div>
                        <a href="javascript:void(0);" onclick="return editCategory(<?php echo $child['category_id']; ?>);">Chỉnh sửa</a> / 
                        <a href="javascript:void(0);" onclick="return deleteCategory(<?php echo $child['category_id']; ?>);">Xoá</a>
                    </td>
                </tr>
            <?php
        }
    }
}
?>
</table>